package com.chinasofti.manager.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.chinasofti.dao.EmpAttenceRepository;
import com.chinasofti.manager.service.AdminAttenceService;
import com.chinasofti.model.EmpAttence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Creator: <br>
 * Date: <br>
 * Description: <br>
 */
@Service
@Component
public class AdminAttenceServiceImpl implements AdminAttenceService {
    @Autowired
    private EmpAttenceRepository empAttenceRepository;

    @Override
    public List<EmpAttence> queryAttenceList() {
        List<EmpAttence> attences = empAttenceRepository.findAll();
        for (EmpAttence attence : attences){
            if (attence.getAtime().equals(attence.getLtime())){
                attence.setLtime(null);
            }
        }
        return attences;
    }

}
